package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.AnLiDaoImpl;
import com.ysd.dao.impl.JuTiXinWenDaoImpl;
import com.ysd.dao.impl.XinWenFenLeiDaoImpl;
import com.ysd.entity.AnLi;
import com.ysd.entity.JuTiXinWen;
import com.ysd.entity.XinWenFenLei;

public class NewsDetailServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		JuTiXinWenDaoImpl juTiXinWenDao = new JuTiXinWenDaoImpl();
		List<JuTiXinWen> juTiXinWen =  juTiXinWenDao.getJuTiXinWen();
		request.setAttribute("juTiXinWen", juTiXinWen);
		
		
		XinWenFenLeiDaoImpl xinWenFenLeiDao = new XinWenFenLeiDaoImpl();
		List<XinWenFenLei> xinWenFenLei = xinWenFenLeiDao.getXinWenFenLei();
		request.setAttribute("xinWenFenLei", xinWenFenLei);
		
		AnLiDaoImpl anLiDao = new AnLiDaoImpl();
		List<AnLi> anLi =  anLiDao.getAnLi();
		request.setAttribute("anLi", anLi);
		
		request.getRequestDispatcher("article_list_content.jsp").forward(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
